
// Inicializar
Event.observe(window, 'load', function() {   
	MainForm = $('frmConfig');  
	
	refresh();
	
});


var refresh = function(){
	new Ajax.Updater('vistaInfo', 'login.htm', {
		parameters: {'method':'configData'},
		onCreate: function(){
			$('vistaInfo').innerHTML = "Espere...";
		}
	});
}


var doEdit = function(flag){
	
	if(isEmpty(flag)) flag = true;
	
	if(flag){
		new Ajax.Updater('vistaEditar', 'login.htm', {
			parameters: {'method':'configData', tipo:'editar'},
			onCreate: function(){
				
			},
			onComplete: function(){
				
				$('btnEditar').style.display="none";
				$('vistaInfo').style.display="none";
				$('vistaEditar').style.display="";
			},
			onException: function(t, e){
				alert(e.message);
			}
		});
	}else{
		$('btnEditar').style.display="";
		$('vistaInfo').style.display="";
		$('vistaEditar').style.display="none";
	}
	
};